package imooc;

import java.util.Scanner;

public class demo2 {
    public static void main(String[] args) {
        int clsNum = 3;
        int stuNum = 4;
        int sum = 0;
        double avg = 0;
        Scanner sc = new Scanner(System.in);
        for (int i = 1; i <= clsNum; i++) {
            System.out.println("请输入第" + i + "个班级的学员成绩:");
            sum = 0;
            for (int j = 1; j <= stuNum; j++) {
                int score = sc.nextInt();
                sum += score;
            }
            avg = sum / stuNum;
            System.out.println("第" + i + "个班级的总分为:" + sum);
            System.out.print("第"+i+"个班级的平均分为:"+avg);
        }

    }
}
